package edu.sctu.jarime.june.day20150618.HttpURLConnection.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by user19 on 2015/6/19.
 */
public class PathUtilDemo {
    public static String getpath(HashMap<String,String> paramMap){
        String path=null;
        String param=null;
        Set entries = paramMap.entrySet();
        Iterator iter = entries.iterator();
        while (iter.hasNext()){
            Map.Entry entry = (Map.Entry)iter.next();
            Object key =entry.getKey();
            Object value =entry.getValue();
            param=key+"="+value;
            path=param+"&"+path;
        }
        path = path.substring(0,path.length()-5);
        return path;
    }
}
